<template>
	<div style="padding:0px;">
		<el-form :model="dialogForm"  ref="dialogForm" :label-width="formLabelWidth" :rules="rules">
			<el-card class="box-card">
			    <div slot="header" class="clearfix">
			        <span style="line-height: 30px;">订单信息</span>
			    </div>
			    <div  class="text item">
			    	<el-form-item label="订单号"  >
				        <el-input v-model="dialogForm.orderNumber" auto-complete="off" disabled ></el-input>
				    </el-form-item>	
				    <el-form-item label="汽车车型"   >
				        <el-input  v-model="dialogForm.specificationName" auto-complete="off" disabled ></el-input>
				    </el-form-item>
				    <el-form-item label="提车地址(启运地)" >
				      <el-input v-model="dialogForm.supplierAddress" auto-complete="off" disabled></el-input>
				    </el-form-item>
				    <el-form-item label="提车联系人" >
				      <el-input v-model="dialogForm.supplierPerson" auto-complete="off" disabled></el-input>
				    </el-form-item>
				    <el-form-item label="联系人手机号" >
				      <el-input v-model="dialogForm.supplierPhone" auto-complete="off" disabled></el-input>
				    </el-form-item>
				</div>
			</el-card>
			<el-card class="box-card" style="margin-top:15px;">
			    <div slot="header" class="clearfix">
			        <span style="line-height: 30px;">物流信息</span>
			    </div>
			    <div  class="text item">
			    	<el-form-item label="物流公司"  prop="logisticCompanyId" >
				      <el-select v-model.number="dialogForm.logisticCompanyId" placeholder="请选择物流公司" disabled>
				      	<option value="" label="请选择物流公司"></option>
					    <!-- <el-option
					      v-for="item in logisticsCompanyList"
					      :key="item.id"
					      :label="item.name"
					      :value="item.id">
					    </el-option> -->
					  </el-select>
				    </el-form-item>
				    <el-form-item label="验车司机信息"  prop="driverInfo">
				      <el-input type="textarea" :rows=3 v-model="dialogForm.driverInfo" auto-complete="off" :maxlength='200' disabled></el-input>
				    </el-form-item>
				   <el-form-item label="目的地省市县(区)"   class="v-distpicker-width is-required">
					    <countySelect  v-if='dialogForm.cityNid' :provinceNid="dialogForm.provinceNid" :cityNid="dialogForm.cityNid" :countyNid="dialogForm.countyNid"  :isDisabled="false" v-on:receive-city-data="receiveCityData" ></countySelect>
				    </el-form-item>
					<el-form-item label="目的地"  prop="destination">
				      <el-input  v-model="dialogForm.destination" auto-complete="off" disabled :maxlength="30"></el-input><!-- maxlength=5 -->
				    </el-form-item>
				    <el-form-item label="物流费"  prop="logisticsFee" class="currency">
				      <el-input  v-model="dialogForm.logisticsFee" @blur="FormatTwo('logisticsFee')" auto-complete="off" :maxlength="11" disabled></el-input>
				      <span class="convertCurrency">{{dialogForm.logisticsFee|convertCurrency}}</span>
				    </el-form-item>
				    <el-form-item label="放空费用"  prop="basicFee" class="currency">
				      <el-input  v-model="dialogForm.basicFee" @blur="FormatTwo('basicFee')" auto-complete="off" :maxlength="11" disabled></el-input>
				      <span class="convertCurrency">{{dialogForm.basicFee|convertCurrency}}</span>
				    </el-form-item>
				     <el-form-item label="预计验车时间(小时)"  prop="estimatedInspectTime">
				      <el-input v-model="dialogForm.estimatedInspectTime" auto-complete="off" :maxlength="30" disabled></el-input>
				    </el-form-item>
				    <el-form-item label="预计运输时间(天)"  prop="estimeatedDays">
				      <el-input v-model="dialogForm.estimeatedDays" auto-complete="off" :maxlength="30" disabled></el-input>
				    </el-form-item>
				    <el-form-item label="公里数"  prop="mileage">
				      <el-input  v-model="dialogForm.mileage" auto-complete="off" disabled></el-input>
				    </el-form-item>
			    </div>
			</el-card>
		    <el-card class="box-card" style="margin-top:15px;">
			    <div slot="header" class="clearfix">
			        <span style="line-height: 30px;">物流确认</span>
			    </div>
			    <div  class="text item">
			    	<el-form-item label="审核信息"  >
			    	   <el-radio-group v-model.number="dialogForm.tatus" :disabled="!dialogSendData.isAdd">
					      <el-radio :label="1">通过</el-radio>
					      <el-radio :label="0">不通过</el-radio>
					   </el-radio-group>
				    </el-form-item>
				    <el-form-item label="审核备注"  >
				      <el-input type="textarea" :rows=3 v-model="dialogForm.remark" auto-complete="off" :maxlength="200" :disabled="!dialogSendData.isAdd"></el-input>
				    </el-form-item>	
			    </div>
			</el-card>
		</el-form>
		<div style="text-align:right;margin-top:15px;">
			 <el-button @click="returnBack">返 回</el-button>
			 <el-button v-if="dialogSendData.isAdd" type="primary" @click="submitConfirmForm('dialogForm')">提 交</el-button>
		</div>
	</div>
</template>
<script  >
    import agentHttp from '@/utils/agentHttp.js';
    import {require,prop,phone,decimalTwo,decimalFour,isChinese,max100} from '@/utils/rules.js'
	export default{ 
		created(){  
		   
        },
		data(){
				return{
					rules: {

			        },
					dialogForm:{
						tatus:""
					},
					formLabelWidth:'170px'
				}
			},props:[
			    'dialogSendData','tableData','carOrderId'
			    ]
			,methods:{	
				returnBack (){
					this.dialogSendData.dialogFormVisible=false; 
				},
				submitConfirmForm(formName){ 
	            	this.$refs[formName].validate((valid) => {
			          if (valid) {
			          	this.submitOrder();
			          } else {
			          	this.$nextTick(()=>{
			          	   setTimeout(()=>{this.$message.warning(document.getElementsByClassName('el-form-item__error')[0].innerText);},200) 
			               return false;
			            })
			          }
			        });
				},
				submitOrder(){	
					agentHttp.postJson('adminApi/admin/car_order/first_audit_order/temporary_sumbit',this.dialogForm).then((data)=>{
			            if(data.success){  
			            	this.$emit('refreshTableData');
			            	this.dialogSendData.dialogFormVisible=false; 
			            	this.$message.success(data.data||"提交成功");
			            } 
			        }) 
			    }
			}
	};
		 
</script>